Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

321
Vistas
Stack underflow (0 <=> 2) when deploying a smart contract

I'm developing a contract and a Web 3.0 using Hardhat, Ethers.js, Node.js and Web3.0 (Metamask) to do ETH smart contracts and transactions and I'm getting a rare error when trying to execute the function 'eth_sendTransaction' while deploying a contract, not transferring ETH from one account to another, from Metamask's RPC API.

The code that I have is:

async function awaitContract(contractAddress, currentAccount, parsedAmount) {
    return await ethereum.request({
        method: 'eth_sendTransaction',
        params: [{
            from: currentAccount, //window.ethereum.request({ method: "eth_accounts" })[0]
            gas: '0x124F80',
            value: parsedAmount._hex,
            data: contractAddress', //contract address (0x....)
        }]
    });
}

I first compile and deploy the contract to the blockchain, but then I want to create new specific instances of the contract using eth_sendTransaction I get the error.

According to Metamask's RPC API docs (https://eth.wiki/json-rpc/API#eth_sendtransaction), If I don't specify the address to but I specify the data field, a new contract should be created.

My surprise comes when I go to search the transaction result to Etherscan and I see the following error:

Warning! Error encountered during contract execution [stack underflow (0 <=> 2)]

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda